"""
______________________________
time：2021/6/21
______________________________
xbb系统首页
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

from Common.basepage import Basepage
from PageLocators.home_page_locs import HomePageLocs as location


class HomePage(Basepage):

    def is_exit_exist(self):
        # 判断首页是否有当前登录用户姓名的 元素，有则返回True，无则返回False
        try:
            # self.wait.until(EC.visibility_of_element_located(location.login_username_loc))
            self.wait_element_visible(location.login_username_loc, "首页_等待当前登录人信息出现")
        except:
            return False
        else:
            return True
